<template>
	<view class="reset-result-layout">
		<image class="reset-result-icon" src="/static/my/reset_success.png" mode="aspectFit"></image>
		<text class="reset-result-text">{{msg}}</text>
		<text class="reset-result-msg">{{remark}}</text>
		<view class="submit-btn btn" @tap="buttonClick">{{btnTitle}}</view>
	</view>
</template>

<script setup>
	import { onLoad } from '@dcloudio/uni-app'
	import { computed, ref } from 'vue';
	const props = defineProps(['title','remark'])
	const msg = ref('')
	const btnTitle = ref('')
	const remark = ref('')
	
	const buttonClick = ()=>{
		if(props.title == '重新认证'){
			uni.navigateTo({
				url:'/pages/my/auth/auth'
			})
		}
		else if(props.title == '找回密码'){
			uni.navigateBack()
		}
		else{
			uni.switchTab({
				url:'/pages/home/home'
			})
		}
	}
	onLoad(() => {
		uni.setNavigationBarTitle({
			title:props.title
		})
		if(props.title == '重新认证'){
			msg.value = '认证失败'
			remark.value = props.remark
			btnTitle.value = '知道了，重新提交认证'
		}
		else if(props.title == '找回密码'){
			msg.value = '成功找回!'
			btnTitle.value = '去登录'
		}
		else{
			msg.value = '成功修改密码!'
			btnTitle.value = '返回首页'
		}
	})
</script>

<style lang="scss" scoped>
	.reset-result-layout {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 100rpx 30rpx;

		.reset-result-icon {
			width: 220rpx;
			height: 220rpx;
		}
		.reset-result-text {
			font-size: 30rpx;
			margin-top: 90rpx;
		}
		.reset-result-msg{
			margin-top: 30rpx;
			font-size: 28rpx;
			color: $xh-color-9;
		}
		.btn {
			width: 100%;
			margin-top: 90rpx;
		}
	}
</style>